$(function(){
	cutTime();
	$("#cutDown").on("click",function(){
		var $this = $(this);
		var dialogName = $this.attr("model");
		infoModel = new dialog(dialogName);
	});
	$("#submitInfo").on("click",function(){
		var $infoForm = $("#infoForm"),
			$phoneIpnut = $("#phone"),
			$telphoneIpnut = $("#telphone"),
			$wechatIpnut = $("#wechat"),
			phoneTxt = $phoneIpnut.val(),
			telphoneTxt = $telphoneIpnut.val(),
			wechatTxt = $wechatIpnut.val();
		var formValidate = new validate();
		if(!(formValidate.checkNull(phoneTxt))){
			$(".error-msg").removeClass("none").html("电话号码不能为空");
			return false;
		}
		if(!(formValidate.checkNull(telphoneTxt))){
			$(".error-msg").removeClass("none").html("手机号不能为空");
			return false;
		}
		if(!(formValidate.checkNull(wechatTxt))){
			$(".error-msg").removeClass("none").html("微信号不能为空");
			return false;
		}
		if(!(formValidate.checkPhone(phoneTxt))){
			$(".error-msg").removeClass("none").html("请输入正确的电话号码");
			return false;
		}
		if(!(formValidate.checkTelphone(telphoneTxt))){
			$(".error-msg").removeClass("none").html("请输入正确的手机号码");
			return false;
		}
		formValidate.reset($infoForm);
		infoModel.close();
		succeedModel = new dialog("succeedDialog");
	});
	$("#share").on("click",function(){
		succeedModel.close();
		showShare();
	});
})
